/**
 * alert和confirm美化 begin
 */
//jquery-confirm配置参数
jconfirm.defaults = {
    title:'提示信息',
    confirmButton: '确认',
    cancelButton: '取消',
    theme:'material',//对话框的颜色主题，可选值有：'white', 'black', 'material' , 'bootstrap'
    //icon:'fa fa-warning',
    type:'blue',
    typeAnimated:true,
    boxWidth:'30%',
    useBootstrap:false,
    draggable: true
};



/*通用弹出框*/
function alert(content) {
    $.alert({
        content: content,
        autoClose: 'confirm|3000',
        backgroundDismiss: true, // this will just close the modal
        animationSpeed: 300 ,// 0.3 seconds
        buttons: {
            confirm:{
                text:"确认",
                btnClass: 'btn-blue',
                action:function () {

                }
            }
        }
    });
}

/*通用弹出框的回调函数*/
function call_alert(content, _callback) {
    $.alert({
        content: content,
        buttons: {
            confirm: function () {
                _callback(true);
            }
        }
    });
}

/*通用确认框的回调函数*/
function confirm(content,_callback) {
    $.confirm({
        content: content,
        backgroundDismiss: true, // this will just close the modal
        buttons: {
            //下面的confirm和cancel是button的名字
            confirm:{
                text:"确认",
                btnClass: 'btn-blue',
                action:function () {
                    _callback(true);
                }
            } ,
            cancel:{
                text:"取消",
                action:function () {
                    _callback(false);
                }
            }
        },
        onClose: function () {
            // before the modal is hidden.
            // alert('onClose');
        },
        onAction: function (btnName) {
            // when a button is clicked, with the button name
            // alert('onAction: ' + btnName);
        },
    });
}

/**
 * alert和confirm美化 end
 */